@extends('layouts.index')
@section('title', '我的收藏')
@section('content')
    <div class="layui-row" style="padding-top: 0;margin-top: 20px">
        <div class="layui-col-lg10 layui-col-lg-offset1">
            <div class="card">
                <div class="card-header">个人中心->我的收藏</div>
                <div class="card-body">
                    <div class="layui-row">
                        <div class="layui-col-lg3 layui-hide-xs">
                            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                                <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                                <li class="layui-nav-item layui-nav-itemed">
                                    <a href="javascript:;">个人中心</a>
                                    <dl class="layui-nav-child">
                                        <dd><a href="javascript:;">消息中心</a></dd>
                                        <dd><a href="{{ route('user_addresses.index') }}">地址管理</a></dd>
                                        <dd><a href="{{ route('products.favorites') }}">我的收藏</a></dd>
                                        <dd><a href="{{route('cart.index')}}">购物车</a></dd>
                                    </dl>
                                </li>
                                <li class="layui-nav-item"><a href="">优惠券</a></li>
                                <li class="layui-nav-item"><a href="">服务中心</a></li>
                            </ul>
                        </div>
                        <div class="layui-col-lg9 layui-col-xs12 ">
                            <div class="row products-list">
                                @foreach($products as $product)
                                    <div class="layui-col-xs6 layui-col-md4 layui-col-lg3 product-item">
                                        <div class="product-content">
                                            <div class="top">
                                                <div class="img">
                                                    <a href="{{ route('products.show', ['product' => $product->id]) }}">
                                                        <img src="{{ $product->image_url }}" alt="">
                                                    </a>
                                                </div>
                                                <div class="price"><b>￥</b>{{ $product->price }}</div>
                                                <a href="{{ route('products.show', ['product' => $product->id]) }}">{{ $product->title }}</a>
                                            </div>
                                            <div class="bottom">
                                                <div class="sold_count">销量 <span>{{ $product->sold_count }}笔</span></div>
                                                <div class="review_count">评价 <span>{{ $product->review_count }}</span></div>
                                            </div>
                                        </div>
                                    </div>
                                @endforeach
                            </div>
                        </div>
                    </div>
                    <div class="float-right">{{ $products->render() }}</div>
                </div>
            </div>
        </div>
    </div>
@endsection